# Copyright 2008 Ryan Whaley
# This file is part of gradient.
# 
# gradient is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# gradient is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with gradient.  If not, see <http://www.gnu.org/licenses/>.

from google.appengine.ext import db

class Semester(db.Model):
  name = db.StringProperty(required=True)
  gpa = db.FloatProperty()
  semesterHours = db.FloatProperty()
  user = db.UserProperty()

class Course(db.Model):
  title = db.StringProperty(required=True)
  deptCode = db.StringProperty(verbose_name="Dept Code")
  courseCode = db.StringProperty(verbose_name="Course Code")
  grade = db.StringProperty()
  hours = db.FloatProperty()
  user = db.UserProperty()
  semester = db.ReferenceProperty(Semester)

class Assignment(db.Model):
  course = db.ReferenceProperty(Course)
  name = db.StringProperty(required=True)
  due = db.DateProperty()
  gradeType = db.StringProperty(default='Regular', choices=['Regular','Extra Credit'], required=True)
  score = db.FloatProperty()
  possible = db.FloatProperty()
  amountOfCorpus = db.FloatProperty()
